'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);
  router.get('/api/banner',controller.home.banner)
  router.get('/api/menu',controller.home.menu)
  router.post('/api/login',controller.user.login)
  router.get('/api/message_code',controller.user.message_code)
  router.get('/api/tabmenu',controller.home.tab)
  router.get('/api/products',controller.product.products)
  router.get('/api/classify', controller.product.classify);
  router.post("/api/detail/:id",controller.user.detail)
  router.post('/api/searchSuggestions',controller.product.searchSuggestions)
  router.post('/api/address',controller.user.createAddress)

  router.post('/api/car',controller.car.add)
  router.post('/api/car',controller.car.list)
  router.put('/api/car/:id',controller.car.update)
  router.delete('/api/car/:id',controller.car.delete)
};
